package com.sun.androidexerciseproject.widget.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.sun.androidexerciseproject.widget.base.BaseFragment;

import java.util.List;

/**
 * Created by Steven on 2016/12/27 0027.
 */

public class FragmentAdapter extends FragmentPagerAdapter {
    List<BaseFragment> mBaseFragmentList;

    public FragmentAdapter(FragmentManager fm, List<BaseFragment> baseFragments) {
        super(fm);
        mBaseFragmentList = baseFragments;
    }

    @Override
    public Fragment getItem(int position) {
        return mBaseFragmentList.get(position);
    }

    @Override
    public int getCount() {
        return mBaseFragmentList.size();
    }
}
